/*
 * engine.h
 *
 *  Created on: Jan 12, 2011
 *      Author: dima
 */

#ifndef ENGINE_H_
#define ENGINE_H_

#include "prerequisites.h"

#include <pthread.h>
#include <unistd.h>

#include "threadsafetype.h"
#include "resourcemanager.h"
#include "platform.h"
#include "renderer.h"


class Engine
{
private:
        bool mInitialized;
        ThreadSafeType<bool> mRunning;
        Engine();
        ~Engine();

        int mFramerate;

        pthread_t mRenderThread;
        pthread_t mUpdateThread;
public:


        void init();
        void destroy();
        void run();
        void requestExit();

        static int start();
        static void* renderLoop(void* );
        static void* updateLoop(void* );

};
#endif /* ENGINE_H_ */
